package com.itheima.homework3;

import java.util.Scanner;

public class homework3 {
    public static void main(String[] args) {
        /*
        键盘录入一个字符串，使用程序实现在控制台遍历该字符串。
         */
        Scanner sc= new Scanner(System.in);
        System.out.println("请输入一个字符串:");
        String s = sc.nextLine();
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }
        System.out.println("---------------------------");
        for (int i = 0; i <s.length(); i++) {
            char ss = s.charAt(i);
            System.out.println(ss);
        }

    }
}
